package pack0622;

public class DemoI {
    public static void main(String[] args){
        for (int x=1;x<1000;x++) {
            int sum=0;
            for (int y = 1; y < x; y++) {
                if (x % y == 0) {
                    sum += y;
                }
            }
            if (x==sum) {
                System.out.print(x + " ");
            }
        }
    }
}
